#include<iostream>
using namespace std;
#include<algorithm>
#include<cmath>

const int N = 3e3 + 10;
int a[N];

void solve1() {
	int n, m;
	int min_val = 3e5+10;
	cin >> n >> m;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	int count = 0;
	for (int i = 1; i <= n - m + 1; ++i) {
		count = 0;
		for (int j = 0; j <= m - 1; ++j) {
			count += a[i + j];
		}
		if (count < min_val)
			min_val = count;
	}

	cout << min_val;

	return;
}

int ac[82];
void solve2() {
	int s1, s2, s3;
	cin >> s1 >> s2 >> s3;
	for (int i = 1; i <= s1; ++i) {
		for (int j = 1; j <= s2; ++j) {
			for (int k = 1; k <= s3; ++k) {
				ac[i + j + k]++;
			}
		}
	}
	int ret_val = 1; //返回值
	int ret_count = 1;  //返回值的次数
	for (int i = 3; i <= s1 + s2 + s3; ++i) {
		if (ac[i] > ret_count) {
			ret_count = ac[i];			
			ret_val = i;
		}
		/*if (ac[i] == ret_count) {			
			if (i < ret_val)
				ret_val = i;
		}*/
	}
	cout << ret_val;
	return;
}

const int M = 2e6 + 10;
int a3[M];
void solve3() {
	int n;
	cin >> n;
	double a;
	int b;
	for (int i = 1; i <= n; ++i) {
		cin >> a >> b;
		//for (double i = a; i <= double(a * b + a/2); i += a) {
		//	int temp = i; //截断小数部分
		//	a3[temp]++;
		//}
		for (int i = 1; i <= b; i++) {
			int temp = double(a * i);//截断小数部分
			a3[temp]++;
		}
	}

	for (int i = 1; i <= 2e6; ++i) {
		if (a3[i] % 2 != 0) {
			cout << i;
			break;
		}
			
	}
	

	return;
}


int a4[10][10];
void solve4() {
	int n;
	cin >> n;
	int begin_val = 1;
	int now = 2;
	a4[1][1] = 1;
	int x = 1, y = 1;
	while (now <= n * n) {
		while (y + 1 <= n && a4[x][y + 1] == 0) { //从左往右
			y++;
			a4[x][y] = now;
			now++;
		}
		while (x + 1 <= n && a4[x + 1][y] == 0) { //从上往下
			x++;
			a4[x][y] = now;
			now++;
		}
		while (y - 1 >= 1 && a4[x][y - 1] == 0) { //从右往左
			y--;
			a4[x][y] = now;
			now++;
		}
		while (x - 1 >= 1 && a4[x - 1][y] == 0) { //从下往上
			x--;
			a4[x][y] = now;
			now++;
		}
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			printf("%3d",a4[i][j]);
		}
		cout << '\n';
	}

	return;
}

int a5[20][20];
void solve5() {
	int n;
	cin >> n;
	a5[1][1] = a5[2][1] = a5[2][2] = 1;
	for (int i = 3; i <= n; ++i) {
		a5[i][1] = 1;
		a5[i][i] = 1;

		for (int j = 2; j < i; ++j) {
			a5[i][j] = a5[i - 1][j] + a5[i - 1][j - 1];
		}		
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= i; ++j) {
			cout << a5[i][j] << " ";
		}
		cout << "\n";
	}



	return;
}


int a6[105][105];
void solve6() {
	int n, m, k;
	cin >> n >> m >> k;
	int count_6 = 0;
	//火把
	for (int i = 1; i <= m; ++i) {
		int x, y;
		cin >> x >> y;
		if (x == 1 && y == 1) {
			a6[x][y] = 1;
			continue;
		}
		a6[x][y] = 1;
			
		a6[x+1][y] = 1;
		a6[x+2][y] = 1;

		if (x - 2 > 0) {
			a6[x - 2][y] = 1;
		}
		if (y - 2 > 0) {
			a6[x][y - 2] = 1;
		}
		if (y - 1 > 0) {
			a6[x - 1][y - 1] = 1;
			a6[x][y - 1] = 1;
			a6[x + 1][y - 1] = 1;
		}
		if (x - 1 > 0) {
			a6[x - 1][y] = 1;
			a6[x - 1][y + 1] = 1;
		}

		a6[x][y + 1] = 1;
		a6[x][y + 2] = 1;
		a6[x + 1][y + 1] = 1;

			
	}
	//萤石
	for (int i = 1; i <= k; ++i) {
		int x, y;
		cin >> x >> y;
		for (int j = (x - 2 > 1 ? x - 2 : 1); j <= x + 2; ++j) {
			for (int k = (y - 2 > 1 ? y - 2 : 1); k <= y+2; ++k) {
				a6[j][k] = 1;
			}
		}
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			if (a6[i][j] == 0)
				count_6++;
		}
	}
	cout << count_6;
	return;
}


void solve7() {
	int begin;
	cin >> begin;
	int second;
	int flag = 1;

	int j = 1;
	while (cin >> second) {
		if (flag == 1) {
			for (int k = 1; k <= second; ++k) {
				cout << 0;
				++j;
				if (j > begin) {
					cout << '\n';
					j = 1;
				}
			}
			flag = 0;
		}
		else {  // flag == 0
			for (int k = 1; k <= second; ++k) {
				cout << 1;
				++j;
				if (j > begin) {
					cout << '\n';
					j = 1;
				}
			}
			flag = 1;
		}
	}

	

	return;
}



void solve8() {
	string s;
	string temp;
	while (cin >> temp) {
		
		s += temp;
	}
	int a = sqrt(s.size());
	cout << a << " ";

	int a8_count = 0;
	char expected = '0';
	for (int i = 0; i < s.size(); ) {
		if (s[i] == expected) {
			a8_count++;
			++i;
			continue;
		}
		cout << a8_count << " ";
		a8_count = 0;
		expected = (expected == '0' ? '1' : '0');

	}
	cout << a8_count << " ";


	return;
}


int a9[41][41];
void solve9() {
	int n;
	cin >> n;
	a9[1][2] = 1;
	int tianchong = 2;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			a9[i][j] = tianchong;
			tianchong++;
		}
	}


	return;
}

int main() {

	//solve1();
	//solve2();
	//solve3();
	//solve4();
	//solve5();
	//solve6();
	//solve7();
	//solve8();
	solve9();

	return 0;
}